package com.example.javapracticaltraining.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.javapracticaltraining.entity.BaseData;
import java.util.Date;
import lombok.Data;

/**
 * 老人病例记录表
 * @TableName medical_record
 */
@TableName(value ="medical_record")
@Data
public class MedicalRecord implements BaseData {
    /**
     * 
     */
    @TableId(value = "record_id", type = IdType.AUTO)
    private Integer recordId;

    /**
     * 老人ID
     */
    @TableField(value = "elderly_id")
    private Integer elderlyId;

    /**
     * 疾病名称
     */
    @TableField(value = "disease_name")
    private String diseaseName;

    /**
     * 诊断日期
     */
    @TableField(value = "diagnosis_date")
    private Date diagnosisDate;

    /**
     * 诊断医院
     */
    @TableField(value = "diagnosis_hospital")
    private String diagnosisHospital;

    /**
     * 诊断医生
     */
    @TableField(value = "doctor_name")
    private String doctorName;

    /**
     * 疾病类型
     */
    @TableField(value = "disease_type")
    private Object diseaseType;

    /**
     * 疾病状态
     */
    @TableField(value = "disease_status")
    private Object diseaseStatus;

    /**
     * 主要症状
     */
    @TableField(value = "main_symptoms")
    private String mainSymptoms;

    /**
     * 诊断依据
     */
    @TableField(value = "diagnosis_basis")
    private String diagnosisBasis;

    /**
     * 治疗方案
     */
    @TableField(value = "treatment_plan")
    private String treatmentPlan;

    /**
     * 当前用药
     */
    @TableField(value = "current_medication")
    private String currentMedication;

    /**
     * 过敏史
     */
    @TableField(value = "allergy_history")
    private String allergyHistory;

    /**
     * 家族病史
     */
    @TableField(value = "family_history")
    private String familyHistory;

    /**
     * 医生建议
     */
    @TableField(value = "doctor_advice")
    private String doctorAdvice;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MedicalRecord other = (MedicalRecord) that;
        return (this.getRecordId() == null ? other.getRecordId() == null : this.getRecordId().equals(other.getRecordId()))
            && (this.getElderlyId() == null ? other.getElderlyId() == null : this.getElderlyId().equals(other.getElderlyId()))
            && (this.getDiseaseName() == null ? other.getDiseaseName() == null : this.getDiseaseName().equals(other.getDiseaseName()))
            && (this.getDiagnosisDate() == null ? other.getDiagnosisDate() == null : this.getDiagnosisDate().equals(other.getDiagnosisDate()))
            && (this.getDiagnosisHospital() == null ? other.getDiagnosisHospital() == null : this.getDiagnosisHospital().equals(other.getDiagnosisHospital()))
            && (this.getDoctorName() == null ? other.getDoctorName() == null : this.getDoctorName().equals(other.getDoctorName()))
            && (this.getDiseaseType() == null ? other.getDiseaseType() == null : this.getDiseaseType().equals(other.getDiseaseType()))
            && (this.getDiseaseStatus() == null ? other.getDiseaseStatus() == null : this.getDiseaseStatus().equals(other.getDiseaseStatus()))
            && (this.getMainSymptoms() == null ? other.getMainSymptoms() == null : this.getMainSymptoms().equals(other.getMainSymptoms()))
            && (this.getDiagnosisBasis() == null ? other.getDiagnosisBasis() == null : this.getDiagnosisBasis().equals(other.getDiagnosisBasis()))
            && (this.getTreatmentPlan() == null ? other.getTreatmentPlan() == null : this.getTreatmentPlan().equals(other.getTreatmentPlan()))
            && (this.getCurrentMedication() == null ? other.getCurrentMedication() == null : this.getCurrentMedication().equals(other.getCurrentMedication()))
            && (this.getAllergyHistory() == null ? other.getAllergyHistory() == null : this.getAllergyHistory().equals(other.getAllergyHistory()))
            && (this.getFamilyHistory() == null ? other.getFamilyHistory() == null : this.getFamilyHistory().equals(other.getFamilyHistory()))
            && (this.getDoctorAdvice() == null ? other.getDoctorAdvice() == null : this.getDoctorAdvice().equals(other.getDoctorAdvice()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRecordId() == null) ? 0 : getRecordId().hashCode());
        result = prime * result + ((getElderlyId() == null) ? 0 : getElderlyId().hashCode());
        result = prime * result + ((getDiseaseName() == null) ? 0 : getDiseaseName().hashCode());
        result = prime * result + ((getDiagnosisDate() == null) ? 0 : getDiagnosisDate().hashCode());
        result = prime * result + ((getDiagnosisHospital() == null) ? 0 : getDiagnosisHospital().hashCode());
        result = prime * result + ((getDoctorName() == null) ? 0 : getDoctorName().hashCode());
        result = prime * result + ((getDiseaseType() == null) ? 0 : getDiseaseType().hashCode());
        result = prime * result + ((getDiseaseStatus() == null) ? 0 : getDiseaseStatus().hashCode());
        result = prime * result + ((getMainSymptoms() == null) ? 0 : getMainSymptoms().hashCode());
        result = prime * result + ((getDiagnosisBasis() == null) ? 0 : getDiagnosisBasis().hashCode());
        result = prime * result + ((getTreatmentPlan() == null) ? 0 : getTreatmentPlan().hashCode());
        result = prime * result + ((getCurrentMedication() == null) ? 0 : getCurrentMedication().hashCode());
        result = prime * result + ((getAllergyHistory() == null) ? 0 : getAllergyHistory().hashCode());
        result = prime * result + ((getFamilyHistory() == null) ? 0 : getFamilyHistory().hashCode());
        result = prime * result + ((getDoctorAdvice() == null) ? 0 : getDoctorAdvice().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", recordId=").append(recordId);
        sb.append(", elderlyId=").append(elderlyId);
        sb.append(", diseaseName=").append(diseaseName);
        sb.append(", diagnosisDate=").append(diagnosisDate);
        sb.append(", diagnosisHospital=").append(diagnosisHospital);
        sb.append(", doctorName=").append(doctorName);
        sb.append(", diseaseType=").append(diseaseType);
        sb.append(", diseaseStatus=").append(diseaseStatus);
        sb.append(", mainSymptoms=").append(mainSymptoms);
        sb.append(", diagnosisBasis=").append(diagnosisBasis);
        sb.append(", treatmentPlan=").append(treatmentPlan);
        sb.append(", currentMedication=").append(currentMedication);
        sb.append(", allergyHistory=").append(allergyHistory);
        sb.append(", familyHistory=").append(familyHistory);
        sb.append(", doctorAdvice=").append(doctorAdvice);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}